<template>
  <div style="padding: 0 12px;" @click="toggleClick" title="切换侧边栏">
    <el-icon class="hamburger" :class="{ 'is-active': isActive }">
      <Fold v-if="!isActive" />
      <Expand v-else />
    </el-icon>
  </div>
</template>

<script setup lang="ts">
import { Expand, Fold } from '@element-plus/icons-vue'

interface Props {
  isActive: boolean
}

defineProps<Props>()

// 发射事件
const emit = defineEmits<{
  toggleClick: []
}>()

const toggleClick = () => {
  emit('toggleClick')
}
</script>

<style scoped></style>
